/*
 * $Id: String.hpp 59 2009-02-19 10:30:57Z hyunghwan.chung $
 *
   Copyright 2005-2009 Chung, Hyung-Hwan.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an  BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */

#ifndef _XP_BAS_STRING_CLASS_
#define _XP_BAS_STRING_CLASS_

#include <xp/bas/BaseString.hpp>
#include <xp/bas/ctype.h>

XP_BEGIN_NAMESPACE2 (xp, bas)

struct StringOpSet
{
	bool isDigit (xp_char_t c) const
	{
		return xp_isdigit (c);
	}
	bool isSpace (xp_char_t c) const
	{
		return xp_isspace (c);
	}
	xp_char_t toUpper (xp_char_t c) const
	{
		return xp_toupper (c);
	}
	xp_char_t toLower (xp_char_t c) const
	{
		return xp_tolower (c);
	}

	int vsprintf (xp_char_t* buf, xp_size_t size, const xp_char_t* fmt, xp_va_list ap) const;
};

typedef BaseString<xp_char_t, StringOpSet> String;
typedef BasePtrString<xp_char_t, StringOpSet> PtrString;

XP_END_NAMESPACE2 (xp, bas)

#endif
